package com.idp.web.test.service.impl;
import com.idp.web.test.service.AccountService;
import com.idp.web.test.dao.AccountDao;
import com.idp.web.test.entity.Account;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.idp.common.persistence.Page;
import com.idp.common.util.ResourceUtils;

/**
 * 
 * ----service实现类
 * 
 * <pre>
 * 	历史记录：
 * 	2017-06-02 Amber
 * 	新建文件
 * </pre>
 * 
 * @author 
 * <pre>
 * SD
 * 	Amber
 * PG
 *	Amber
 * UT
 *
 * MA
 * </pre>
 * @version $Rev$
 *
 * <p/> $Id$
 *
 */
@Transactional
@Service("accountService")
public class AccountServiceImpl implements AccountService {

	@Resource
	private AccountDao accountDao;
	
	@Override
	public Page<Account> findByPage(Account account, Page<Account> page) {

		page.setResult(accountDao.find(account, page));
		
		return page;
	}
	
	@Override
	public List<Account> findBySearch(Account account) {

		return accountDao.find(account);
	}
	
	@Override
	public Account getById(Integer id) {

		return accountDao.getById(id);
	}

	@Override
	public void add(Account account) {

		accountDao.add(account);
	}
	
	@Override
	public void update(Account account) {

		accountDao.update(account);
	}

	@Override
	public void delete(Integer id) {

		accountDao.delete(id);
	}
 	
}